#!/bin/bash
cat secure |egrep Failed|egrep invalid|tr -s " "|cut -d " " -f11|sort|uniq -c >file1
cat secure |egrep Failed|egrep  -v invalid|tr -s " "|cut -d " " -f9|sort|uniq -c >>file1
cat secure |egrep Failed|egrep invalid|tr -s " "|cut -d " " -f13|sort|uniq -c >file2
cat secure |egrep Failed|egrep  -v invalid|tr -s " "|cut -d " " -f11|sort|uniq -c >>file2
echo "按照用户分类："
cat file1|sort -k1 -nr
echo "按照IP地址分类："
cat file2|sort -k1 -nr
